﻿using System;
using System.IO;
using System.Xml.Serialization;
using System.Xml;

namespace LAPI.Core.Helpers
{
    public class TextFileHelper
    {        
        public static string FileToString(string fileName)
        {
            var text = string.Empty;
            using (StreamReader sr = new StreamReader(fileName))
            {
                var line = string.Empty;
                while ((line = sr.ReadLine()) != null)
                    text += line;
            }

            return text;
        }

        public static void StringToFile(string fileName, string text)
        {
            using (TextWriter textWriter = new StreamWriter(fileName))
            {
                textWriter.WriteLine(text);
            }
        }
    }
}
